import { baseUrl, doRequestPost, doRequestDel, doRequestPut, doRequestGet } from '@/utils/request'

export function databaseList(query) {
  return doRequestPost(baseUrl + 'cms/dbsourceconfig/list' + '?time=' + (+new Date()), query)
}

export function databaseAdd(query) {
  return doRequestPost(baseUrl + 'cms/dbsourceconfig/add' + '?time=' + (+new Date()), query)
}

export function databaseTestAdd(query) {
  return doRequestPost(baseUrl + 'cms/dbsourceconfig/testAdd' + '?time=' + (+new Date()), query)
}
export function databaseTest(query) {
  return doRequestPost(baseUrl + 'cms/dbsourceconfig/test' + '?time=' + (+new Date()), query)
}

export function databaseDelete(query) {
  return doRequestPost(baseUrl + 'cms/dbsourceconfig/delete/' + query.id + '?time=' + (+new Date()), {})
}

export function databasePut(query) {
  return doRequestPost(baseUrl + 'cms/dbsourceconfig/update' + '?time=' + (+new Date()), query)
}

export function databaseGet(query) {
  return doRequestGet(baseUrl + 'cms/dbsourceconfig/get/' + query.id + '?time=' + (+new Date()), {})
}

export function dataSourceList(query) {
  return doRequestPost(baseUrl + 'cms/sourceconfig/list' + '?time=' + (+new Date()), query)
}

export function dataSourceAdd(query) {
  return doRequestPost(baseUrl + 'cms/sourceconfig/add' + '?time=' + (+new Date()), query)
}

export function dataSourceTest(query) {
  return doRequestPost(baseUrl + 'cms/sourceconfig/test' + '?time=' + (+new Date()), query)
}

export function dataSourceDelete(query) {
  return doRequestPost(baseUrl + 'cms/sourceconfig/delete/' + query.id + '?time=' + (+new Date()), {})
}

export function dataSourcePut(query) {
  return doRequestPost(baseUrl + 'cms/sourceconfig/update' + '?time=' + (+new Date()), query)
}

export function dataSourceGet(query) {
  return doRequestGet(baseUrl + 'cms/sourceconfig/getEdit/' + query.id + '?time=' + (+new Date()), {})
}

export function dataSourceSetTime(query) {
  return doRequestPost(baseUrl + 'cms/sourceconfig/enable' + '?time=' + (+new Date()), query)
}

export function dataSourceMonitorList(query) {
  return doRequestPost(baseUrl + 'news/analysis/record/list' + '?time=' + (+new Date()), query)
}

export function dataSourceMonitorAllList(query) {
  return doRequestPost(baseUrl + 'news/analysis/record/all' + '?time=' + (+new Date()), query)
}

export function dataSourceMonitorCount(query) {
  return doRequestPost(baseUrl + 'news/analysis/record/count' + '?time=' + (+new Date()), query)
}

export function dataCategoryList(query) {
  return doRequestPost(baseUrl + 'cms/dataDict/list/' + query.type + '?time=' + (+new Date()), query)
}